import { useState, useEffect } from "react"
import { channelAPI } from "@/apis/article"

function useChannels() {
    const [channelList, setChannelList] = useState([])
    useEffect(() => {
        const getChannelList = async () => {
            const res = await channelAPI()
            // console.log(res.data.channels);
            setChannelList(res.data.channels)
        }
        getChannelList()
    }, [])

    return { channelList }
}

export default useChannels;